package n04;

import java.time.LocalDateTime;
import java.time.temporal.ChronoUnit;

public class F03 {
	public static void main(String[] args) {
		LocalDateTime d1 = LocalDateTime.parse("2025-02-24T00:00:00");
		LocalDateTime d2 = LocalDateTime.parse("2025-03-02T23:59:59");
		LocalDateTime d3 = LocalDateTime.parse("2025-03-03T00:00:00");
		System.out.println(d1.until(d2, ChronoUnit.WEEKS)); //0 相差的周数
		System.out.println(d1.until(d3, ChronoUnit.WEEKS)); //1
		System.out.println(d1.until(d2, ChronoUnit.DAYS));  //6 相差的天数
		System.out.println(d1.until(d3, ChronoUnit.DAYS));  //7
		System.out.println(d1.until(d2, ChronoUnit.HOURS));  //167=24*7-1
		System.out.println(ChronoUnit.HOURS.between(d1, d2)); //167 相差的小时数

	}
}
